package org.sp1.jdbc;

import org.sp1.dao.LoginDao;
import org.sp1.model.SpLoginLog;
import org.springframework.jdbc.core.JdbcTemplate;

public class LoginImpl implements LoginDao{
	
	private JdbcTemplate jdbcTemplate;

	public void setJdbcTemplate(JdbcTemplate jdbcTemplate) {
		this.jdbcTemplate = jdbcTemplate;
	}

	public void insertLoninLog(SpLoginLog spLoginLog) {
		// TODO 自动生成方法存根
		
		String sql="insert into sp_login_log(user_id,ip,login_datetime) "
			       + " values(?,?,?)";
		
		Object[] args={spLoginLog.getId().getUserId(),spLoginLog.getId().getIp(),spLoginLog.getId().getLoginDatetime()};
		
		jdbcTemplate.update(sql, args);
		
	}
	

}
